Expose ports on Azure VMRole - powershell

Can we expose ports on a Azure VMRole after we have published the project onto Azure?
Probably using Azure Powershell cmdlets or some other way.
At present, I am deleting the VMRole and adding new endpoints on my project (Visual Studio Azure Project) and re-publish it.

I'm pretty sure the answer is no for cloud apps. (VM Role is one type of role for a cloud app.) Endpoints have to be declared before publishing.

Related

How to publish azure service fabric project from command line (powershell, cmd, etc.)

What I have:
Several separate repositories with .NET solutions.
Each solution has a Service Fabric Project (.sfproj).
Each sfproj has a needed publish profile.
Local Service Fabric cluster, which is used for development/debugging.
What I need:
I want to create a ps script which will go solution by solution and deploy the projects to the local service fabric cluster. Right now I'm opening each solution in VS and I'm publishing the app from VS. And it takes a lot of time.
Main question:
How to write a command that will build and publish the sfproj using needed publish profile?
P.S.: I have read Azure service fabric create package command line question here. But I don't understand how to include the needed publish profile.

How to integrate OnPrem Azure DevOps Server with the cloud one?

My firm has the Azure DevOps online version where we have all our projects and repo's. We were not able to configure CI/CD for the repo's because our internal server network doesn't have access to the internet.
To overcome this issue, we built a new server that has access to the internet and also to the internal network. On the new server, we installed and configured Azure DevOps Server 2019. We don't want to migrate our repo's from the cloud version to the online version.
I am trying to link the OnPrem repo to the cloud repo but it was not working. I issued a PAT on the cloud version and added it as a service connection under Pipelines in the OnPrem version but still, I am not able to see and link the cloud repo's.
I can clone the repo from the cloud to the OnPrem server but that will not get the latest code as the code is being checked in the cloud repo's
Can anyone please guide me on how to link both of them, please.
Thanks!!!
I don't think there's a meaningful way to integrate Azure DevOps Services and Azure DevOps Server, as they are essentially the same product. I assume (but don't know) that you're looking to integrate Azure DevOps Services to on-premise builds and deployments, as you state that you want to keep the repos in Azure DevOps Services. So, in essence, you want to run build and deployment group agents in on-premise environment.
Take a look at the agent-documentation and especially the communication subsection:
https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/agents?view=azure-devops
Or this old blog post, from which the communication section originates:
https://devblogs.microsoft.com/devops/deploying-to-on-premises-environments-with-visual-studio-team-services-or-team-foundation-server/
The ideal solution would probably be that you run self-hosted build agents in your server that's open to internet, and configure an agent pool for them in Azure DevOps Services. For deployments, you'll want to use Deployment Groups and install deployment group agents to target servers, where they'll just need outbound 443 access for communicating with Azure DevOps Services.
If that's not possible, you'd have to install deployment agents to the build machine, which then sees your other on-premise servers, but this is rather unsatisfactory solution since you'd either have to rely on WinRm capabilities for deployments, or expose too much network between your build server and other on-premise servers.

Azure Service Fabric - Multiple application deployment through Azure DevOps

I have a two microservices applications running in Azure Service fabric cluster. I don't have any issue when I deploy the applications from Visual Studio. But when I try to deploy the applications through Azure DevOps CI/CD pipeline I'm getting the below error.
[error]Found more than one item with search pattern D:\a\r1\a**\drop\projectartifacts**\PublishProfiles\Cloud.xml. There can be only one.
From this error message what I can understand I should have only one Cloud.xml file in the solution.
I would like to know the best practices to create multiple applications in Azure Service Fabric cluster and how to resolve the error.
You have two SF applications in the solution. If you are building both and dropping then on the same folder, you will have two cloud.xml files.
Because you specified a broad search pattern, it will find both.
You didn't tell which task is throwing this exception, I will assume it is the Deploy Service Fabric Application.
To deploy both applications, you should have two steps, one pointing to each application, then you should fix the search pattern to be more specific on which SF App you are deploying.

How to add non azure vm into VSTS Deployment groups

As we know we can add azure vm as a machine into our VSTS deployment group using the PowerShell script which VSTS provides. Based on that we can create new release definition and add our machine into pipeline.
Question is there any way to add non azure vm into VSTS deployment group?
The script that is provided is agnostic to cloud providers and can be used on any machine with powershell and internet connectivity.

Configure Bitbucket deployment to Azure Website with Powershell

I'm trying to provision some Azure Websites using Powershell and am not sure how to configure Bitbucket deployment. Is this possible? Using the Service Management cmdlets I see that there is explicit support for Github deployment, but not Bitbucket. Perhaps there's a way using the new Resource Manager cmdlets, but there's very little documentation that I can find.
This feature isn't yet present in the PowerShell New-AzureWebsite Cmdlet and can only be configured when provisioning a new Website via the Management Portal.