Manifest icons in custom Azure DevOps extension hubs and hub groups - azure

I am developing an Azure DevOps extension. Experimenting with the DevOps UI extension sample raises a question for me. I enabled the Preview features in Azure DevOps having a more fancy UI. Azure default hubs and hub groups like Tests, Repos and so on do have a nice coloured icons in the menu bar. Whereas my custom Sample UI do not. They are just grey. And it looks like I cannot manifest icons for my custom hubs and hub groups. Anybody here who knows more about this issue?

Follow this guide will most likley solve your problem
Make sure your vss.extension.json file follow this pattern:
{
"id": "my-extension",
"publisherId": "my-publisher",
...
"contributions": [
{
"id": "example-hub",
"type": "ms.vss-web.hub",
"targets": [
"ms.vss-code-web.code-hub-group"
],
"properties": {
"name": "My Hub",
"iconAsset": "my-publisher.my-extension/images/fabrikam-logo.png",
"_sharedData": {
"assets": [
"my-publisher.my-extension/images/fabrikam-logo.png"
]
}
}
}
],
"files": [
{
"path": "images/fabrikam-logo.png",
"addressable": true
}
]
}

Related

Is it possible to use RBAC to allow read only access to an App Service's Application Settings?

I would like provide read only access to an the Application Settings of an app service. Specifically by Application Settings of an App Service, I'm referring to the 4 tabs that appear when you open an App Service in the portal and select Configuration > Application settings from the menu:
[![enter image description here][1]][1]
My understanding is the built in reader role does not give access to these, while the built in contributor role does give write access to these. The built in contributor role seems to heavy handed of an approach.
I would have expected it to be something like:
{
"id": "/subscriptions/xxxxx/providers/Microsoft.Authorization/roleDefinitions/xxxx",
"properties": {
"roleName": "Example Custom Reader",
"description": "Build in Azure Reader role+ ability to read app service config",
"assignableScopes": [
"/subscriptions/bcd6dbed-c3ec-4951-bdbe-9aa6550a54dc"
],
"permissions": [
{
"actions": [
"*/read",
"Microsoft.Web/sites/config/Read"
],
"notActions": [],
"dataActions": [],
"notDataActions": []
}
]
}
}```
[1]: https://i.stack.imgur.com/3LmBR.png
I believe you're looking for microsoft.web/sites/config/web/appsettings/read for a single Web App, and microsoft.web/sites/config/appsettings/read for all Web Apps

Microsoft defender for cloud - environment settings - auto provisioning

When trying to get list of all auto provisioning extensions using REST API (https://learn.microsoft.com/en-us/rest/api/defenderforcloud/auto-provisioning-settings/list?tabs=HTTP) I'm getting only the default one - Log Analytics agent/Azure Output:
"value": [
{
"id": "/subscriptions/blahblahblah/providers/Microsoft.Security/autoProvisioningSettings/default",
"name": "default",
"type": "Microsoft.Security/autoProvisioningSettings",
"properties": {
"autoProvision": "On"
}
}
]
}
Does anyone have an idea how to get the other auto provisioning extensions state?
Vulnerability assessment for machines
Microsoft Defender for Containers components.
UI representation of auto-provisioning extensions

What is the difference between Pipelines - Create and Definitions - Create in Azure DevOps REST API?

I was trying to create a yml pipeline with Pipeline - Create Azure DevOps REST API and it was throwing an exception 'No pool was specified' even though I have mentioned pool in the yml file. More details of this issue is available here.
Please find below, the request body used for creating pipeline.
{
"folder": "",
"name": "pipeline-by-api",
"configuration": {
"type": "yaml",
"path": "/azure-pipelines.yml",
"repository": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "repo-by-api",
"type": "azureReposGit"
}
}
Then I identified a second REST API, Definitions - Create and using this I was able to successfully create a pipeline. Please find below the request body used for creating build definition.
{
"process":{
"yamlFilename": "azure-pipelines.yml"
},
"queue":{
"pool":{
"name": "Azure Pipelines"
}
},
"repository": {
"id": "00000000-0000-0000-0000-000000000000",
"type": "TfsGit",
"name": "repo-by-api",
"defaultBranch": "refs/heads/master"
},
"name": "pipeline-by-api",
"path": "\\API-Test",
"type": "build",
"queueStatus": "enabled"
}
I would like to understand what's the difference between the two. I have tried Definitions - Create as Pipelines - Create was not working for me. But is this a correct way of creating pipeline?
Definitions - Create is an older endpoint. It was availabe before YAML pipeline becomes first class citizens. Pipelines - Create is a new endpoint suited for YAML pipelines. Both can be used to create pipeline and if you change API version to 4.1 you will see that Pipelines is not available.
If I have to guess, they find a reason to create a new endpoint for handling yaml pipelines, probably to avoid some breaking changes, but this is only a guess.

API to add properties to Azure Webapp Application settings

I have one web app running on a Azure appservice plan. The web app has a lot of settings defined in Application settings of the Web App. Now I want to replicate that web app with all its Application settings. I got the REST API to list down all the settings available for any web app (/api/settings). Although there is a POST call to add/update the settings , But it is not updating Application settings.
Is there any REST API to add/update the Application settings of Azure web app ?
Thanks,
Abhiram
Is there any REST API to add/update the Application settings of Azure web app ?
Yes, we could update the application setting with the following Update Application Settings REST API
Put https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resource group}/providers/Microsoft.Web/sites/{WebAppName}/config/appsettings?api-version=2016-08-01
Body
{
"id": "subscriptions/{subscriptionId}/resourceGroups/{resource group}/providers/Microsoft.Web/sites/{WebAppName}/config/appsettings",
"name": "appsettings",
"type": "Microsoft.Web/sites/config",
"location": "South Central US",
"tags": {
"hidden-related:/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/tomfreePlan": "empty"
},
"properties": {
"WEBSITE_NODE_DEFAULT_VERSION": "6.9.1",
"Test1": "testValue1" //Added value
}
}
Note: we could use the following List Application Settings REST API post way to list the appsetting body.
Post https://management.azure.com/subscriptions/{subscription}/resourceGroups/CXP-{resourceGroup}/providers/Microsoft.Web/sites/{WebAppName}/config/appsettings/list?api-version=2016-08-01
To my knowledge, there is not. But have you considered scripting your Web App settings with an ARM template? This is exactly the kind of thing that ARM templates are intended for.
An example of the properties section of a Web App's ARM template that lets you script appSettings and connectionStrings is listed below:
"properties": {
"name": "YourWebAppsName",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', YourAppServicePlanName)]",
"siteConfig": {
"appSettings": [
{
"name": "someAppSettingKey",
"value": "someAppSettingValue"
},
{
"name": "someOtherAppSettingKey",
"value": "someOtherAppSettingValue"
}
],
"connectionStrings": [
{
"name": "defautlConnection",
"connectionString": "YourConnectionString",
"type": "2"
},
]
}
When you deploy an ARM template, Azure will ensure that the target resource's settings match what's specified in your template.
Visual Studio has a project type for developing and deploying these. It's the Azure Resource Group project type located under the Cloud node in the project templates.
As an added bonus, you can check these ARM templates into source control alongside your code.

I can't see proxies for Azure Function App

I have created an azure function app in VS 2017.
i've included a proxies.json file and published the app.
However I can't see the proxies in the Azure portal.
All it says is:
Proxies (preview) (Read Only)
I have gone into function settings, and there are no settings to enable proxies. I think that was the old method, (not for developing the function in visual studio)
proxies.json looks like this:
{
"$schema": "http://json.schemastore.org/proxies",
"proxies": {
"user": {
"matchCondition": {
"methods": [ "GET" ],
"route": "/user/{user}"
},
"backendUri": "https://<mycontainer>.blob.core.windows.net/html/test.html/{user}"
}
}
}
Ok I figured it out....
the proxies.json file should have copy to output directory as "copy always" in the properties panel in VS.

Resources