Changing Azure web role name? - azure

Is it possible to change a web role name through PowerShell or any other programmatic way without needing to change the project name itself? We need role name change for monitoring purpose and changing project name would require a lot of work for us with modifying build definitions.

There seems to be a work around way which is from a blog of a MS developer, to update role name via modify the Role schema file.
Hope it helps.

Rename Azure Cloud Service.ps1
import-module Azure
# download publish settings
Get-AzurePublishSettingsFile
# import settings you just downloaded
Import-AzurePublishSettingsFile "C:\Users\<user>\Downloads\MySub-DATE-credentials.publishsettings"
# view subscription details
Get-AzureSubscription
# select active subscription
Select-AzureSubscription 'MySub'
# view cloud services for selected sub
Get-AzureService
# update cloud service name/description
Set-AzureService 'myServiceName' 'Friendly Service Name' 'Detailed Service Description'

Related

Is there a PowerShell cmdlet to get the resources that reference a domain name in Azure Active Directory?

Before deleting a custom domain from Azure Active Directory (AAD), I first need to get a list of all users, groups, and applications that reference that custom domain. This can be done manually through the Azure portal
Is there a way to get this list through PowerShell? I see the PowerShell cmdlet Get-MsolDomain, but I do not see that this outputs this kind of information.
I recommend to use cmdlet Get-AzureADDomainNameReference -Name '' from module AzureAD.
You can install that module from PowerShell Gallery - https://www.powershellgallery.com/packages/AzureAD/

Azure DevOps: Why is my subscription not shown when creating a new service connection?

I am using Azure DevOps with a Microsoft Account (#outlook.com). The same account is co-administrator of 3 different Azure Subscriptions.
I am trying to create a new Service connection from my Azure DevOps Project to my newest Azure Subscription (out of the 3).
When I:
Go to my project's Project Settings view and click on the Service Connections tab.
Click on the 'New service connection' button.
Choose 'Azure Resource Manager' for the connection type.
Choose 'Service Principal (automatic)' authentication method.
I find that the drop-down list for Subscription is only showing my two older subscriptions and my newer subscription is missing, as shown here:
How can I get my third, newer, subscription to appear in the 'Subscription' list?
I've tried the following without success:
Made my Microsoft Account to be a 'Co-administrator' of the Azure Subscription.
Gave my Microsoft Account the 'Owner' Role for the Azure Subscription.
Added my Microsoft Account to the 'Global Administrators' group in Azure Active Directory.
Set 'Guest users permissions are limited' to 'No' in the In my Active Directory's External collaboration settings.
UPDATE: The subscription that's not shown in the list is currently a "free-tier" subscription whereas the 2 subscriptions that are shown are "pay-to-go". Could this be the reason for my problem?
This is what solved it for me:
Go to your MS Azure account.
Search and go to 'Tenant Properties'.
Click on Manage Security Defaults.
Turn these off
I can finally see my Azure Subscription in the Subscription list. I'm not 100% sure which step I took is responsible for fixing the issue so I'll list 2 things that I did:
In the Azure Portal I created a new App Registration, this time having the "Supported account types" setting set to "Accounts in any organizational directory ... and personal Microsoft account ...":
In PowerShell and using the AzureAD module I reset the Service Principal Key Credential:
a. Ran PowerShell (v5.1) "as Administrator".
b. Install-Module -Name AzureAD
c. Connect-AzureAD -TenantId <tenant-id-from-the-app-registration-overview>
b. New-AzureADServicePrincipalKeyCredential -ObjectId <object-id-from-the-managed-application-overview>
PS - The Subscription's being in the free-tier seems to be irrelevant to the issue.
You can try accessing DevOps in a private mode, it simply gets the existing subscription.
Not an exact answer to the OP's question, but I think it's related and maybe helpful to others. My issues was creating a new subscription and that subscription not showing up on the Subscriptions page.
Click on the "Directories + subscriptions" button in top right.
Open dropdown and ensure desired subscriptions are selected
Navigate to Subscriptions page and click on "Subscriptions == globalfilter" and selected desired subscriptions.
See if you have a "default subscription filter" set on the Portal Settings page. Seems to add one by default.
I solved the problem by deleting an old app registration with an expired certificate. I'm not sure about the link between the two, maybe it forced a refresh somewhere.

Not able to make an Azure app as member of an Azure Group

I would like to add an Azure app as member of the Azure Group. I am owner of the Group but when I click on Add-->Member , it only lists individual users and there is no option for adding an app:-
I am not trying to provide access to the SG so it can access the app (for that I will have to go to the specific app page) rather I am trying to make the app as the 'member' of an Azure group that I already own. But I just don't see an option for doing that.
If your group is an Office group, it does not support to add the service principal as a member(i.e. the MSI of your datafactory, which is essentially a service principal created by azure automatically in general, see this link).
If you want to add the service principal to the group, you need to use the Security group, see this link.
If your User type is member, but you are not able to create the Security group, the UsersPermissionToCreateGroupsEnabled setting should be set with false in your Azure AD tenant.
See To restrict the default permissions for member users:
For more details, refer to this link.
You need to run this command first from powershell to create the managed identity
Set-AzDataFactoryV2 -ResourceGroupName <resourceGroupName> -Name <dataFactoryName> -Location <region>
https://learn.microsoft.com/en-us/azure/data-factory/data-factory-service-identity

Change Azure Cloud Service environment variable without publishing

Is it possible to change an environment variable on an Azure Cloud Service without publishing? I'd like to be able to change a variable and then restart my app, but I don't need to re-deploy.
To change the configuration settings in the portal, login into the portal (Please note that currently the preview portal does not support cloud services) and the select your cloud service and then click on CONFIGURE tab. You will see all settings there.
You can also change the configuration settings through Azure PowerShell Cmdlets as well. So what you would do is make the change in the cscfg file and then execute Set-AzureDeployment Cmdlet. Following is an example of changing the configuration file:
Set-AzureDeployment -Config -ServiceName "MySvc1" -Slot "Staging" -Configuration "C:\Temp\MyServiceConfig.Cloud.csfg"
Some points I do want to mention in the answer:
You can only change the settings stored in *.cscfg file without redeploying your code. If there are settings in your app/web.config file which you want to change, then you would have to redeploy the application.
If you want to add new settings, then you have to redeploy the application. You can't add new settings dynamically at this time.

Is It possible to rename hosted service in Windows Azure

Is It possible to rename hosted service of windows azure? I created it with a wrong name and I want to rename it.
Seems not possible. You might have to remove and recreate.
You can relabel the Azure Hosted Cloud Service by using the Azure Powershell SDK. You just need to download the publish settings before you can execute any Azure Cmdlets. Use Set-AzureService to update the Azure Cloud Service name.
Rename Azure Cloud Service.ps1
import-module Azure
# download publish settings
Get-AzurePublishSettingsFile
# import settings you just downloaded
Import-AzurePublishSettingsFile "C:\Users\<user>\Downloads\MySub-DATE-credentials.publishsettings"
# view subscription details
Get-AzureSubscription
# select active subscription
Select-AzureSubscription 'MySub'
# view cloud services for selected sub
Get-AzureService
# update cloud service name/description
Set-AzureService 'myServiceName' 'Friendly Service Name' 'Detailed Service Description'

Resources