How to easily and quickly debug a Azure Devops dashboard widget? - azure-devops

I'm writing a dashboard widget for an Azure Devops dashboard, and I'm finding the cycle of modify-publish-refresh dashboard-set breakpoints in Chrome tools-refresh page again to be rather tedious.
Is there a way to test or debug a dashboard widget directly within Visual Studio or VS Code?
I'm using Add a dashboard widget as a starting template for my widget - happy to change though!

You can develop locally. Since Azure DevOps uses an iframe to show your extension's content, you can run a local server and reference that in the vss-extension.json manifest.
By default, when you launch the Developer Tools, the Developer Console is in the context if the primary page, or the top window. In other words, you're able to access the top window's DOM and state. Use the "Target" dropdown (shown above) to switch the context to your extension's frame. You are now able to access the DOM and global state of your extension's frame.
Besides, you could also use an official extension Azure DevOps Extension Hot Reload and Debug.
This repository demonstrates how to load an Azure DevOps extension's
code directly from the dev machine rather than bundle all the code and
deploy it through the marketplace. We will leverage the (somewhat
hidden) capability in Azure DevOps to load content from localhost,
which will enable us to use hot reload and debug in VS Code.
More detail info and ways, please kindly refer below links:
Debug a web extension
How to debug VSTS extension build summary tab without deploying to VSTS service?
How to debug and develop Azure DevOps extension without deployment?

Related

Run Azure DevOps extension in the background

Is it possible to run Azure DevOps Web extension when you open any azure devops page?
Probably, there is exists something like "type": "ms.vss-web.azure-load-action" that starts when you open Azure DevOps Website.
In common way, extension contribution runs in a certain scenarios, like - opening hub, opening context menu, etc. Can you run an extension contribution in global context - after azure devops website was opened?
PS. I'he already searched in the VSTS samples, extension points and azure devops extension samples
Thank you, have a nice day!
Unfortunately, extensions don't support "load action". We use extensions to enhance Azure DevOps and Team Foundation Server (TFS) with new web experiences, dashboard widgets, build tasks, and more. You may submit a user voice at website below:
https://developercommunity.visualstudio.com/content/idea/post.html?space=21

Deploy to Azure Extension - Only Allows Creation of Github Actions Workflow. Wont Allow GitHub + Azure Pipelines Flow Creation

I am following the steps outlined here. I am using the Deploy to Azure Extension
https://learn.microsoft.com/en-us/azure/devops/pipelines/targets/deploy-to-azure-vscode?view=azure-devops#github--azure-pipelines
I have done the following steps.
I have managed to create a simple react app and then got the GitHub + GitHub Actions portion to work no problem.
Now, I want to get GitHub Plus Azure Pipeline to work. So, I deleted the GitHub Actions/Workflow files, and starting over with the CICD setup.
Next, I have enabled Use Azure Pipelines for GitHub in the extension.
Then, as per the steps/pictures outlined in the above microsoft documentation link, I have begun the configure CICD option from the command palette.
Selected the Visual Studio Subscription
Selected the target web app
Now, at this point, as per the linked tutorial, it is supposed to ask me to choose a azure devops organization, so that the azure pipeline YAML file can kick in. This step never happens.
instead, VS Code will proceed to generate a GitHub Actions Workflow just as it did before.
What should I do to the GitHub to Azure Pipeline working from this extension?
Update 1
In case anyone is curious, I have raised a issue on the visual studio community forum. You can find that here
https://developercommunity.visualstudio.com/content/problem/1182952/github-azure-pipelines-falls-back-to-github-github.html
As of now, there is an ongoing discussion but no solution yet.
You can try reinstalling Deploy to Azure Extension and enable Use Azure Pipelines for GitHub, and then configure CI/CD option again. If the issue persists, you can report this issue here.
You can create a pipeline directly in your azure devops project. Check out below tutorial
Build, test, and deploy JavaScript and Node.js apps
You will also need to create an Azure Resource Manager service connection to deploy to your azure resource from azure devops pipeline.
Deploy an Azure Web App (Linux)

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

How to configure an Azure Functions (C#) project in GitHub to be deployed automatically?

I created an Azure Functions 2.0 (C#) project in VS 2017 and put it in GitHub. If I publish to Azure directly from VS, it works just fine. Then I accessed Azure Portal in order to configure Azure Functions, and there is this option to deploy from GitHub. I configured this option and when I commit something to GitHub, the Azure Portal detects and start some process (in Deployment Center there are logs with "success" status for each change I made in GitHub) but the code isn't deployed.
Any ideas?
Thanks, guys! I found the problem! I first published my solution directly from Visual Studio to Azure. Then, all functions became read-only, so build process did executed with success, but the files aren't updated.
I erased my functions app and recreated manually, and configured deployment with Kudu, getting from GitHub, and then everything works like a charm! Each commit in github updates my app!
Make sure Visual Studio is connected to GitHub to push the azure function
In the deployement center , you need to check that deployement is connected to github
You also need to check the Azure function version 2.
Step by steps guide Referenced from my article
Continuous Azure function deployement from Github using Kudu Build Server

Azure web app configuration

I have been using azure PowerShell tasks to update my app settings in the portal for all the web apps and would like to know if there is any other way to do the same.
I don't want to make the changes in the config files alone. The changes have to be made in the azure portal as well.
There are a few third-party tools to accomplish this and avoid Powershell. Basically it takes your VSTS variables, and sets them in Azure. You install these as release tasks.
Azure WebApp Configuration task
Azure App Service: Set App settings
In current Azure stack you have two options.
For secured settings you should rather use "Azure Key Vault"
For Centralized app settings you should use "Azure App Configuration" which is in public preview.