Help with Powershell + Azure Scripting
- or -
Post a project like this2909
$$
- Posted:
- Proposals: 1
- Remote
- #1129583
- Completed
Description
Experience Level: Intermediate
Estimated project duration: 1 day or less
General information for the business: Help with writing powershell script for Azure automation
Description of requirements/functionality: ############################
Please only apply if you have Powershell experience and access to Azure.
I cannot provide you an Azure account for testing. You just need to create a Azure Web App.
############################
I have an Azure Web App. I need to set application settings using Powershell.
The powershell command for this is : Set-AzureRmResource -PropertyObject $Properties
Here is a working example to set "AlwaysOn = True":
Please see the example-json for the format in Azure to understand how this works.
$PropertiesObject = @{
"alwaysOn" = $true;
}
Set-AzureRmResource -PropertyObject $PropertiesObject -ResourceGroupName $ResourceGroupName -ResourceType Microsoft.Web/sites/config -ResourceName $AzureSiteName/web -ApiVersion 2015-08-01 -Force
I now need to change this script to set various other options within the Web App.
The problem is that these properties are NESTED. Therefore the previous example is not working.
I need someone to work out how to properly format the $PropertiesObject when dealing with nested properties as below.
1. Set CORS URLS
"cors": {
"allowedOrigins": [
"https://my-website.net”
"https://my-website2.net”
]
},
2. Set Logging Configuration
"azureBlobStorage": {
"sasUrl": "https://sas-url.coml",
"retentionInDays": null,
"enabled": true
}
},
#####
This is an example suggested online which is not working
$InnerPropertiesObject = @{
prop1 = "string"
prop2 = 1
}
$PropertiesObject = @{
"Property" = [Object[]]$InnerPropertiesObject
}
Specific technologies required: azure , powershell
Extra notes:
Description of requirements/functionality: ############################
Please only apply if you have Powershell experience and access to Azure.
I cannot provide you an Azure account for testing. You just need to create a Azure Web App.
############################
I have an Azure Web App. I need to set application settings using Powershell.
The powershell command for this is : Set-AzureRmResource -PropertyObject $Properties
Here is a working example to set "AlwaysOn = True":
Please see the example-json for the format in Azure to understand how this works.
$PropertiesObject = @{
"alwaysOn" = $true;
}
Set-AzureRmResource -PropertyObject $PropertiesObject -ResourceGroupName $ResourceGroupName -ResourceType Microsoft.Web/sites/config -ResourceName $AzureSiteName/web -ApiVersion 2015-08-01 -Force
I now need to change this script to set various other options within the Web App.
The problem is that these properties are NESTED. Therefore the previous example is not working.
I need someone to work out how to properly format the $PropertiesObject when dealing with nested properties as below.
1. Set CORS URLS
"cors": {
"allowedOrigins": [
"https://my-website.net”
"https://my-website2.net”
]
},
2. Set Logging Configuration
"azureBlobStorage": {
"sasUrl": "https://sas-url.coml",
"retentionInDays": null,
"enabled": true
}
},
#####
This is an example suggested online which is not working
$InnerPropertiesObject = @{
prop1 = "string"
prop2 = 1
}
$PropertiesObject = @{
"Property" = [Object[]]$InnerPropertiesObject
}
Specific technologies required: azure , powershell
Extra notes:
James S.
100% (11)Projects Completed
15
Freelancers worked with
14
Projects awarded
21%
Last project
21 Jul 2023
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies