Backup or copy Azure Mobile Service scripts? - version-control

I am running a mobile service with an increasing amount of scripted functionality. I want to have these scripts somehow stored in a smart format for version control. I'm having hard time finding any information on such scenarios. Is it even possible Azure -> VS2012 (and TFS) or VS2012 (and TFS) -> Azure?

Currently that is not supported on the portal itself. You can do that by using the Command Line Interface, however, as was shown in this blog post. Basically, you can store the scripts in whichever source control system you want (the post uses Git, but it would work with TFS as well) and use the CLI to update your service whenever a new version of the script is checked in.
You can also vote up the source control feature suggestion on the UserVoice for the system, to have that functionality implemented in the service itself.

You can now link your Azure Mobile scripts to a git repo directly from the Azure Mobile Portal Dashboard, allowing you to edit scripts from VS2012 or another editor.

Related

Test server for release pipeline in Azure DevOps

Forgive me for asking a stupid question. I am from IT Infrastructure background & have been asked to create CI/CD pipelines based on my recent learnings on DevOps.
We have couple of applications whose source code is currently in TFS 2013 & those apps are written in ASP.NET C# language. Now, requirement is to migrate the source code from TFS to Azure Repos (Azure DevOps services) & further create a CI/CD pipeline.
Now for demo purposes, customer is asking us to do the deployment (i.e. Release pipeline) on a test server which is a plain windows 2012 OS without any SQL & IIS for both of these applications. Is that possible & how could we achieve the results to confirm release pipeline is funcioning properly?
In my opinion, it wont work as there is no application infra/configuration done for those applications on that plain test server. I guess we actually need a ready dev/stage environment which is replica of production to do the testing of release pipeline for those applications. Am I correct?
Just need expert advise for confirmation so I communicate the same to customer.
Azure DevOps Pipelines use an agent to perform the deployments. You can run the agent entirely in the cloud when deploying to Azure resources. You can also install an agent locally. Follow this link and scroll down to read about self-hosted agents. This is how you can deploy to your test instance from the pipeline.
Now, what you deploy there may require additional software be installed. You say it's an application in C#. Cool. Now, what's it do? Is it a windows program? Then just having the server there, with an agent installed, is all you need. Is it a web program? Then, yeah, it's going to need an IIS (or whatever) instance available somewhere to deploy to. Is it a database program? Then, yeah, it's going to need a database instance to deploy to. There's nothing magical about having a VM or a machine somewhere. All the same rules have to apply. There has to be an OS, drives, memory, and yes, supporting services depending on the needs of the application.
However, using a local machine instead of a hosted one, that works fine. Just follow the instructions in the link above.

Is there an Azure Pipeline facility for releasing a standard Desktop Application?

Azure is well-suited to publicly releasing developer-oriented artifacts like NuGet packages. And it's great at deploying Web-Apps and things intended for VMs. Plenty of release templates for those. But I can't find much discussion on deploying a simple standard Windows desktop application installer. Does such a facility exist?
Because our pipelines produce two main artifacts we give to customers:
a NuGet packaged SDK for developers
an installer for a standard old Windows Desktop application for end users
Getting #1 out there is easy. But what do I do about #2?
I'm not sure what I was expecting. Maybe something like an Azure-provided publicly-facing page with a list of installer builds I had released. Something my pipeline could feed into directly. Maybe even some provision to require people to enter contact information to download the installer, or a customer-specific URL that would record for us who had downloaded it.
Does this sort of Azure facility exist? Or is this a case where we should just expose a downloads page directly from our own company website?
Is there an Azure Pipeline facility for releasing a standard Desktop Application?
I am afraid there is no such specific Azure Pipeline facility for releasing a standard Desktop Application.
When we release a standard Desktop Application, we could use the copy task or publish build artifact task to deploy standard Desktop Application build artifact, to a network drive folder or target machine directly.
You could check this document and my previous thread for some details.
So,there is no such specific Azure Pipeline facility for standard Desktop Application.
If you really want to use artifacts to manage standard Desktop Application, you could try to use the Universal Package, which store one or more files together in a single unit that has a name and version. we could also publish Universal Packages and download it.

How to integrate powerapps with azure devops

I am doing some research for Powerapps integration with Azure DevOps.
However there is limitated information for it.
It is possible to integrate powerapps inside a Task for AzureDevops?
Based on, that we have a .zip file with the Powerapp, and we want to create a Build and Release/Deploy for several environments.
Thank You.
It is possible to integrate powerapps inside a Task for AzureDevops?
Yes it is.
You can leverage the Solution concept of the Microsoft Power Platform and the Power Apps BuildTools (preview) extension for Azure DevOps.
Update 11/2020: This is now GA and called Power Platform Build Tools
I've written a complete step-by-step guide on this topic:
A Continuous Delivery Approach for No-Code Solutions in Microsoft’s Power Platform
Bottom line:
With this build tool, you can automatically check-in a Solution into source control and deploy it using a continuous delivery approach with the help of Azure DevOps. See the screenshot for a sample configuration of the Export and Import Solution Task.
It works for everything you can organize inside a Solution, e.g.:
Power Apps
Power Automate Flows
AI Builder Models
Common Data Service Entities
It is possible to integrate powerapps inside a Task for AzureDevops?
I am afraid there is no such Task integrate powerapps for AzureDevops at this moment.
If you want to integrate powerapps with azure devops, you can follow the guide step by step:
Microsoft Teams – Integration with Visual Studio Team Services using PowerApps.
Besides, AFAIK, PowerApps should not be "Build/Deployed" through Azure Devops.
When you are developing with PowerApps, there is no way to do Source
Control. There are no source files. The only artifact you can version
control is the .zip file that you can export.
And
In PowerApps, you don’t have to build your code. Any change you make
to the application is live for you to test it. In that way it is very
productive. To publish the application you just click on the publish
button and it is live.
Check this great blog: PowerApps From A DevOps Perspective for some more details.
Hope this helps.
Solutions are a way to package your components in a single zip file and use Powerapps build tools to import your solution on to a different environment or tenant.
It is still a an improvement from manually importing each app or environment variable and then import it on to target system, but it lacks what we call as automation of deployment.
To provide an eg, I will explain what I have done, and what still constitutes of a manual task:
I created an enterprise level app using powerapp canvas model. My app consumes data from around 20 APIs. These API calls are implemented in power automate.
We have 4 environments, dev, sit, uat and prod. Now I cant keep on importing flows in each environment and change their api URLs to point to the deployed environment. So I used environment variables for each environment which stores api URLs for each environment. This can be done under solution.
Under the same solution, I added my app. So now my solution has 2 things, my app and the environment variable which consists of api URLs.
I then use powerapps build tools to move this solution from dev to sit.
Steps: use build tools tasks to perform the following
Export solution
Unpack it in git
Pack it
Import the solution.
This successfully moves my solution to sit.
But the solution environment variable still points to the dev url.
So I have to override environment variables to store sit URLs.
This manual intervention to edit environment variable is as good as doing all the tasks manually.
This was the case when PowerApps was first announced; however, this is no longer the case.
While it is technically true that there is no actual code that would be managed and deployed with a PowerApp or Flow but that doesn't mean that you can not use the power of Azure DevOps. Additionally, when creating a PowerApp / flow you would also be creating entities and even Model Driven apps - and these uses solutions - which naturally work well to deplooy within Azure DevOps.
Microsoft is building out this whole construct to enable all these to deploy...
While the whole incorporation of PowerApps and flows into Solutions is not fully baked yet - they are targeting to have this ready around the October time frame this year.
We have been talking to Microsoft about also enabling PowerApps and flows to follow the same expansion that solutions do so that they can take advantage of the full branching strategy.
So even though you would be simply exporting out zip files into your repo - you can still take advantage of the full devops pipeline which is highly recommended.
Use this component, it still on preview mode but is working fine on my side
https://marketplace.visualstudio.com/items?itemName=microsoft-IsvExpTools.PowerApps-BuildTools

Is there any way to check in items or create a new project from files via the API?

We're starting to automate some of our project kickoff processes. We already have a project management app (built in-house) that creates the base Solution and C# project with some default screens, authentication, etc. and populates some standard data like App Name and Namespace.
Ideally, what I'd like to wind up with is clicking a button in our project management app, having it create a VSTS project for the app, pull the template files and manipulate them as-needed, and check it all in to VSTS as a "ground zero" changeset for that newly created VSTS project. At that point, our dev team can just connect to the project and pull it down in Visual Studio.
From what I'm seeing in the REST APIs documentation for VSTS, you can get a list of changesets and files associated with a changeset, but I'm not seeing any references on adding or checking in files.
Is this something that can be done via the APIs, or some other automated extension mojo?
You can use Rest API to create a new project.
For Version Control, since you mentioned "check in as changeset", I assume you are using TFVC. The Rest API can only get the information about TFVC version control, it cannot check in files for now. If you want to check in files via API, you can consider using .NET client libraries for Visual Studio Team Services (and TFS). Refer to this link for details: Team Foundation Version Control client API example for TFS 2010 and newer. It works with VSTS too.

Source control for server side scripts in Azure Mobile Service

I am using Azure Mobile Services as the backend for my mobile app. Despite my best efforts, my server side scripts are getting complex now. Is there a way I can keep the insert, update, read, delete scripts for the tables in my service, in source control and maybe have a way to deploy them from within Visual Studio?
Have you checked out the node Azure Command Line Tools? This will likely hold the solution to your problems. These tools allow you to neatly manage your mobile service from your dev machine. The newly added cli tools for Mobile Services also support downloading your scripts. Just run the following command in your Azure Powershell:
azure mobile script download <service_name> <script_name>
The script name syntax is as follows:
For tables: table/.{insert|read|update|delete}
Apple Push Notification: shared/apnsFeedback
Scheduler: scheduler/
Once you have your scripts downloaded and placed on your local filesystem, you could put them in source control with your client that consumes your mobile service, or just throw them in their own git repository. You can't, however, sync your source control repository with your mobile service. In order to upload any changes you've made to your scripts, you'd need to execute the following command in the Azure-CLI again:
azure mobile script upload <service_name> <script_name>
I'm not sure if you can upload multiple scripts at once though. You could probably use some of the Azure-CLI Automation scripts I saw Glenn Block post on github. This could allow you to somehow automate uploading the scripts as a part of your build workflow.
Edit:
I found a few more resources that might help you with this:
Getting started with the CLI and backing up your scripts
More CLI – changing your Mobile Services workflow
These are some great resources from Josh Twist. I'm sure they will push you in the right direction.
Since this question has been answered, a new feature has been added to Azure Mobile Services - integration with Git source control. Basically you can enable this feature in the dashboard of your mobile service, and it converts the storage in a Git repository which you can clone / pull and push updates to.
You can find more information in the tutorial at http://www.windowsazure.com/en-us/develop/mobile/tutorials/store-scripts-in-source-control/.