Azure web site Publishing profile and Visual Studio Code Editor? - deployment

Possible to deploy to azure web site using Visual Studio Code editor and an Azure Publishing profile?
How and Where?

According to your description, I suggest you could use git to publish your project to the azure.
More details, you could refer to below steps:
1.Create a web app service in the azure and set the Deployment credentials as below:
Notice: Remember the user name and password.
Set the password and user name:
2.Set the azure web application deployment options to local git.
Choose the source:
3.Copy the git url in web service overview:
4.Open your VS code and right click the project, select the open in the command prompt
5.In the opened windows add below command:
Notice: Change the url as your copied url
git remote add azure https://account#yoursite.scm.azurewebsites.net:443/estruyf-publish.git
git config credential.helper store
git push -u azure master
Then it will fired a login window to type the username and password.
The result as below:
Notice: My VS code version is 1.21.1. It will automatic install the Git. If your VS code doesn't contain the git, you need install it firstly. You could refer to this article.

Related

How to connect my GitHub Enterprise Account with Visual Studio Code

I want to know if it's possible to connect my github enterprise account of my organization to vs code, and if so how?
I know how to sign in with a normal github account on vs code but it doesn't work for github enterprise. I already looked up online but couldn't find any answers.
In the vs code settings there is an option called github enterprise: Uri. I put there the url of my github organization "github.organizationname.com" but I don't know what else I need to do.
Here's what worked for me on vs code 1.62.3.
Clone the GitHub Enterprise repo outside of vs code (ie, using git cli in a terminal or GitHub Desktop).
In vs code, open the folder containing the cloned repo.
And just like magic, it works. If you click on the source control tab in vs code, you can pull changes and make commits. Actually, it might not work quite yet if your cloned project doesn't have your personal access token saved. If you need to do that, you can find instructions in this answer to a different question
I have set it up in the vscode settings like so:
Then it asked for my personal access token. This is token can be created under "settings" -> "developer options"
see: https://docs.github.com/en/enterprise-server#3.4/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
It is possible to login using GitHub enterprise from VS Code without using personal access token or SSH keys. User can login by SSO if session already exist in browser else will need to sign in using their credentials. One of the ways to achieve this is to install Git Credential Manager. Git Credential Manager (GCM) is a secure Git credential helper built on .NET that runs on Windows, macOS, and Linux.
Compared to Git's built-in credential helpers (Windows: wincred, macOS: osxkeychain, Linux: gnome-keyring/libsecret) which provides single-factor authentication support working on any HTTP-enabled Git repository, GCM provides multi-factor authentication support for Azure DevOps, Azure DevOps Server (formerly Team Foundation Server), GitHub, Bitbucket, and GitLab.
For installing GCM based on OS follow the given link:
https://github.com/GitCredentialManager/git-credential-manager
Once GCM is installed and you try to clone a repository you will be able to see Enterprise login page. This can be achieved by using other Git Oauth Authorized Apps such as GitHub CLI.
Another option is to access with you microsoft email and then , the Github enterprise signing option will be added in "Account" just click it and you now will have access to GithubEnterprise
Account bottom in green
more reference here is the link:
https://learn.microsoft.com/en-us/visualstudio/ide/work-with-github-accounts?view=vs-2022

Accessing Azure Devops on premises via Visual Studio

I had installed Azure Devops on our Windows 2019 server. The server has 5 users and all of them were created as local users on the server. I added these 5 users in Dev Ops project. Four of these users started using visual studio directly on the same server and have cloned project from on premises Azure dev ops. When they connected to the Azure dev ops server, they simply used User1, User2.... username and their windows password to connect to the Azure.
After a couple of weeks, we implemented Active Directory and added this server into the active directory group. The existing four users are still able to pull, push the same project. However, when the fifth user which never logged in now needs to connect to the Azure Dev Ops to clone the project. When he tries to connect via Visual Studio, the visual studio adds Domain into the user name e.g. DomainName\User5 and azure dev ops connectivity is not accepting his windows password. This user is not a domain user and is local to the server. This user can login to Azure Dev Ops when accessing it from browser, but unable to connect when trying it from Visual Studio.
Also, when I logged in directly to Azure Dev Ops (on premises) and try to add members to project, it does not show domain users. It only shows local server users.
Do I need to reinstall Azure dev ops, what should be the apprpriate way to fix this issue?
Thanks
When the fifth tried to use Visual Studio to connect the project, and access the project on web browser, did he do these things also directly on the same server machine?
Due the fifth user can access the project on web browser, the account of this user should not have issue. The problem seems occurs on Visual Studio when trying the authentication for the account.
Please try to check with the following things to see if the problem can be solved:
Check if the user has login to Visual Studio with his account.
Check if Visual Studio has saved or cached the account information of other users. If yes, clean the cache. Then login to Visual Studio with the fifth user's account.
When trying to connect to the project on Visual Studio, make sure the the selected user id the fifth user.
If the issue still exists, please share us with the details error message that the fifth user gets.

VSTS Deploy to Azure WebApp For Linux

Is it possible to deploy an application from VSTS to a WebApp on Linux.
My Webapp is a simple ruby app and I'm currently deploying it with the hosted git repo like in the doc: https://learn.microsoft.com/en-us/azure/app-service/containers/quickstart-ruby
git remote add azure <Git deployment URL from above>
git add -A
git commit -m "Initial deployment commit"
git push azure master
Is there a way to do it using a repo in VSTS?
First, the Azure App Service Deployment task supports Web App on Linux app service type, so you can deploy your ruby app through this task, for example:
Create a new build definition
Specify the source with corresponding repository and branch
Add Archive files task to put necessary files to zip file
Add Azure App Service Deploy task (App type: Linux Web App; Image Source: Built-in Image; Package or folder: [zip file in step 3]; Runtime Stack: Ruby 2.3)
Note: You can deploy it through Release.
Secondly, if Deployment option is available, you can configure it in azure portal: Continuous Deployment to Azure App Service.
On the other hand, you also can push source to server through git command as you are using:
Add Command Line task: (Tool: git; Arguments: remove add azure [git deployment URL]; Working folder: $(build.SourcesDirectory)). Note: the git deployment URL should contains username and password, for example: https://[username]:[password]#[app name].scm.azurewebsites.net/[app name].git (username can’t contains # character)
The same as other git command

Deploy meanjs based application hosted in Github to Bluemix

My application using meanjs framework is hosted in Github repository. How do I integrate Bluemix and Git to deploy my application to Bluemix?
Your best option for using Git to deploy to Bluemix from a Github repository is to use this link:
https://bluemix.net/deploy?repository=LINK-TO-YOUR-GITHUB-REPO
This will grab your repository, launch a Bluemix application with it and create a Bluemix DevOps project that allows you to push changes to your application with Git instead of the Cloud Foundry CLI tool.
You can also manually perform this process by starting here (https://hub.jazz.net/create). On this setup page, be sure to select 'Make this a Bluemix Project' so you can deploy your code to Bluemix.
FYI - Just deploying a repository to Bluemix does not mean that it will run on the platform. See here for more info on getting your code to work on Bluemix.
Deploy the project into Bluemix as below:
download meanjs from Github at: https://github.com/meanjs/mean
install dependency packages by npm -install
check and see if the project can run at local by command grunt as meansjs project describes
create a mongolab service in Bluemix with named mean-mongo
check .cfignore file contains below items;
List of files and directories to ignore when deploying to Bluemix (.DS_Store, .nodemonignore, .sass-cache/, npm-debug.log, node_modules/, public/lib, app/tests/coverage/, .bower-*/, .idea/)
push the application by cf push <appname> -p .
Integrate the app to Git
make sure that step 1 completes successfully, and the application is upload to Bluemix successfully
add the app deployed to Bluemix in step 1 to jazz hub by (click the app -> click "ADD GIT" at upper right of the app - > then it will create url to the jazz hub project
login onto jazz hub by clicking "GIT URL" or "EDIT" button at the app page
it will open jazz hub page
further reference
http://www.ibm.com/developerworks/cloud/library/cl-intro1-app/

Using Azure Powershell or the xpat cli how do I connect my web site to a github hook

Using the portal:
Using the portal at https://manage.windowsazure.com/ this is easy. From a newly created azure web site:
Go to the dashboard
On the quick glance options on the right, click "Set up deployment from source control"
On the "where is your source code?" option, select Github
Authorize, then choose the repo name and branch.
BINGO: now pushes to that branch will trigger a deployment of that branch onto the azure website. Lovely.
Here's the problem:
I cannot for the life of me see how to do this from the command line (using the xpat-cli installed using npm: "npm install azure-cli -g")
It seems like I should be typing something like:
azure site deployment github --verbose --githubusername [username] --githubrepository [username/reponame] [sitename]
Because the help for "azure site deployment github" says it will: "Link a website to a github account for deployment"
Doesn't seem to work though...
If I then type:
azure site show [sitename]
The output says the source control is "LocalGit" instead of github - which is what it says if I do it the portal way above.
Source Control
data: --------------
data: Type: LocalGit
Any ideas?
Depending on your use case the solution will be different.
Assuming you have the same github source but want to deploy to multiple different Azure websites
Potential Solution: Make use of the Deploy to Azure Button See details here: https://azure.microsoft.com/blog/2014/11/13/deploy-to-azure-button-for-azure-websites-2/
Assuming you have various repositories that you want to deploy to Azure: Potential Solution: I am assuming that you will be the person deploying it. The workflow will be as follows:
A. Download files from Github to local folder See here
B. Publish your local folder into a new/existing Azure site. See here, or here. There are other github repositories to get some scripts right away
I understand this doesnt directly hook your system to do direct pull, but its one way to do it.
There is also:
http://www.imtraum.com/blog/streamline-git-with-powershell/
https://gallery.technet.microsoft.com/scriptcenter/a-GitHub-Repository-265c0b49
Both documents I found describing how to set up continuous deployment from GitHub say that you can configure the repo and branch with an Azure Resource Manager template, but you have to enter your credentials and complete the authorization process in the portal.
The script used in this tutorial will automatically configure
continuous publishing from your GitHub repository. This requires that
your GitHub credentials are already stored in Azure, otherwise the
scripted deployment will fail when attempting to configure source
control settings for the web apps.
To store your GitHub credentials in Azure, create a web app in the
Azure preview portal and configure GitHub deployment. You only need to
do this once.
I'd also suggest posting your xpat-cli problem as an issue on their GitHub repo.