Visual Studio์ฉ Tools๋ฅผ ์ฌ์ฉํ์ฌ ASP.NET ์ฑ ๋ฐฐํฌ
์ด ํ์ด์ง์์๋ Microsoft Visual Studio๋ฅผ ๊ตฌ์ฑํ๊ณ Google Cloud์์ ASP.NET ์ ํ๋ฆฌ์ผ์ด์ ์ ๋ง๋ค๊ณ ๋ฐฐํฌํ๋ ๋ฐฉ๋ฒ์ ์ค๋ช ํฉ๋๋ค.
์์ํ๊ธฐ ์ ์
-
In the Google Cloud console, on the project selector page, click Create project to begin creating a new Google Cloud project.
-
Verify that billing is enabled for your Google Cloud project.
- ๋ค์ ์ํํธ์จ์ด๊ฐ ๋ก์ปฌ ์์คํ ์ ์ค์น๋์ด ์๋์ง ํ์ธํฉ๋๋ค.
- Visual Studio 2022, Visual Studio 2019, Visual Studio 2017, ๋ชจ๋ Windows ๋ฒ์ . Visual Studio์ฉ Cloud Tools๋ Mac์ฉ Visual Studio 2017์ ์ง์ํ์ง ์์ต๋๋ค.
- gcloud CLI
- ์ฑ์ ํธ์คํ ํ ์ Windows VM์ ๋ง๋ญ๋๋ค.
- Google Cloud Marketplace์์ ASP.NET Framework ์ด๋ฏธ์ง๋ก ์ด๋ํฉ๋๋ค.
ASP.NET Framework ์ด๋ฏธ์ง๋ก ์ด๋ - Compute Engine์์ ์คํ์ ์ ํํฉ๋๋ค.
- ๋ฐฐํฌ ์ด๋ฆ๊ณผ ์ค์ ์ ์ ํํ๊ณ HTTP ํธ๋ํฝ ํ์ฉ๊ณผ WebDeploy ํธ๋ํฝ ํ์ฉ์ด ์ ํ๋์ด ์๋์ง ํ์ธํฉ๋๋ค.
- ๋ฐฐํฌ๋ฅผ ์ ํํฉ๋๋ค.
Cloud Tools for Visual Studio ์ค์น
Visual Studio์ Extensions and Updates(ํ์ฅ ๋ฐ ์ ๋ฐ์ดํธ) ๋ํ์์์์ Cloud Tools for Visual Studio๋ฅผ ์ค์นํ๋ ค๋ฉด ๋ค์ ์๋ด๋ฅผ ๋ฐ๋ฅด์ธ์.
- Tools(๋๊ตฌ) > Extensions and Updates(ํ์ฅ ๋ฐ ์ ๋ฐ์ดํธ)๋ฅผ ์ ํํฉ๋๋ค.
- ์ผ์ชฝ ์ฐฝ์์ Online(์จ๋ผ์ธ) ์์ฑ์ ์ ํํฉ๋๋ค.
- Google Cloud Tools for Visual Studio๋ฅผ ๊ฒ์ํฉ๋๋ค.
- Download(๋ค์ด๋ก๋)๋ฅผ ํด๋ฆญํ๊ณ ํ์๋๋ ๋ฉ์์ง๋ฅผ ๋ฐ๋ฆ ๋๋ค.
- Visual Studio๋ฅผ ๋ค์ ์์ํ์ฌ ํ์ฅ ํ๋ก๊ทธ๋จ์ ๋ก๋ํฉ๋๋ค.
Google์ ๋ก๊ทธ์ธ
App Engine์ ํ๋ก์ ํธ๋ฅผ ๋ฐฐํฌํ๋ ๋ฐ ์ฌ์ฉํ Google ๊ณ์ ์ ๋ก๊ทธ์ธํ๋ ค๋ฉด ๋ค์ ์๋ด๋ฅผ ๋ฐ๋ฅด์ธ์.
- Visual Studio๋ฅผ ์ฝ๋๋ค.
- Tools(๋๊ตฌ) > Google Cloud Tools(Google Cloud ๋๊ตฌ) > Google Cloud Explorer๋ฅผ ์ ํํ์ฌ Cloud Explorer๋ฅผ ์์ํฉ๋๋ค.
- Select or create account(๊ณ์ ์ ํ ๋๋ ๋ง๋ค๊ธฐ)๋ฅผ ํด๋ฆญํฉ๋๋ค.
- ๊ณ์ ์ถ๊ฐ๋ฅผ ํด๋ฆญํฉ๋๋ค.
- ์ ํ๋ฆฌ์ผ์ด์ ์ ์ฌ์ฉํ ๊ณ์ ์ ์ ํํฉ๋๋ค.
- Allow(ํ์ฉ)๋ฅผ ํด๋ฆญํ๊ณ ๋ธ๋ผ์ฐ์ ์ฐฝ์ ๋ซ์ต๋๋ค.
์ ๋ธ๋ผ์ฐ์ ์ฐฝ์ด ์ด๋ฆฌ๊ณ ๋ฆฌ์์ค๋ฅผ ๊ด๋ฆฌํ๋ ๋ฐ ํ์ํ ๊ถํ์ ์์ฒญํฉ๋๋ค. Google Cloud
ํ๋ก์ ํธ ์ ํ
์ ํ๋ฆฌ์ผ์ด์ ์ ๋ฐฐํฌํ Google Cloud ํ๋ก์ ํธ๋ฅผ ์ ํํ๋ ค๋ฉด ๋ค์ ์๋ด๋ฅผ ๋ฐ๋ฅด์ธ์.
- Cloud Explorer์์ Select Project(ํ๋ก์ ํธ ์ ํ)๋ฅผ ํด๋ฆญํฉ๋๋ค.
- ๋ชฉ๋ก์์ ํ๋ก์ ํธ๋ฅผ ์ ํํฉ๋๋ค.
- ํ์ธ์ ํด๋ฆญํฉ๋๋ค.
Cloud Explorer์์ ์ ํํ ํ๋ก์ ํธ์ ๋ฆฌ์์ค๊ฐ ์๋ก ๊ณ ์นจ๋์ด ํ์๋ฉ๋๋ค.
ASP.NET ์ฑ ๋ง๋ค๊ธฐ
์ ASP.NET ํ๋ก์ ํธ๋ฅผ ๋ง๋ค๊ณ ๋ก์ปฌ๋ก ์คํํ๋ ค๋ฉด ๋ค์ ์๋ด๋ฅผ ๋ฐ๋ฅด์ธ์.
- File(ํ์ผ) > New(์๋ก ๋ง๋ค๊ธฐ) > Project(ํ๋ก์ ํธ)๋ฅผ ์ ํํ์ฌ New Project(์ ํ๋ก์ ํธ) ๋ํ์์๋ฅผ ์ฝ๋๋ค.
- ์ผ์ชฝ ํจ๋์ ์ฌ์ฉํ์ฌ Installed(์ค์น๋จ) > Visual C# > Google Cloud Platform์ผ๋ก ์ด๋ํฉ๋๋ค.
- ASP.NET on Google Cloud Platform(Google Cloud Platform์ ASP.NET)์ ์ ํํฉ๋๋ค.
- ํ๋ก์ ํธ์ Name(์ด๋ฆ)์ ์ ๋ ฅํฉ๋๋ค.
- ํ์ธ์ ํด๋ฆญํฉ๋๋ค.
- Template type(ํ ํ๋ฆฟ ์ ํ)์ ์ ํํฉ๋๋ค.
- ํ์ธ์ ํด๋ฆญํฉ๋๋ค.
- ์๋ฃจ์ ์ ๋น๋ํ๊ณ ๋ก์ปฌ๋ก ์คํํ์ฌ ์๋ํ๋์ง ํ์ธํฉ๋๋ค.
์ฑ์ Compute Engine์ VM์ ๋ฐฐํฌํ๋ ค๋ฉด .NET Core๊ฐ ์๋๋ผ .NET Framework๋ฅผ ๋์์ผ๋ก ์ง์ ํ์ธ์. GKE ๋๋ App Engine์ ๊ฒฝ์ฐ์๋ ASP.NET Core on Google Cloud Platform(Google Cloud Platform์ ASP.NET Core)์ ์ ํํ์ธ์.
ASP.NET ์ฑ ๋ฐฐํฌ
ASP.NET ์ฑ์ Compute Engine์์ ์คํ๋๋ Windows VM์ ๋ฐฐํฌํ๋ ค๋ฉด ๋ค์ ์๋ด๋ฅผ ๋ฐ๋ฅด์ธ์.
- Cloud Explorer์์ ์๋ก ์์ฑ๋ ํ๋ก์ ํธ๋ฅผ ์ ํํ๊ณ GKE๋ฅผ ํ์ฅํฉ๋๋ค.
- Cloud Marketplace๋ฅผ ์ฌ์ฉํ์ฌ ์์์ ๋ง๋ VM ์ธ์คํด์ค๋ฅผ ๋ง์ฐ์ค ์ค๋ฅธ์ชฝ ๋ฒํผ์ผ๋ก ํด๋ฆญํฉ๋๋ค.
- Manage Windows credentials(Windows ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด ๊ด๋ฆฌ)๋ฅผ ์ ํํฉ๋๋ค.
- Add credentials(์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด ์ถ๊ฐ)๋ฅผ ํด๋ฆญํฉ๋๋ค.
- ์ฌ์ฉ์ ์ด๋ฆ์ ์ ๋ ฅํฉ๋๋ค.
- Create a password for me(์๋์ผ๋ก ๋น๋ฐ๋ฒํธ ๋ง๋ค๊ธฐ)๊ฐ ์ ํ๋์ด ์๋์ง ํ์ธํ๊ณ Save(์ ์ฅ)๋ฅผ ํด๋ฆญํฉ๋๋ค.
- '[๋ง๋ ์ธ์คํด์ค] ์ธ์คํด์ค์์ [์ฌ์ฉ์ ์ด๋ฆ]์ ๋น๋ฐ๋ฒํธ๋ฅผ ์ฌ์ค์ ํ์๊ฒ ์ต๋๊น?'๋ผ๋ ํ์ธ ์์ฒญ ๋ฉ์์ง๊ฐ ํ์๋๋ฉด ์ฌ์ค์ ์ ํด๋ฆญํฉ๋๋ค.
- Close(๋ซ๊ธฐ) ๋ฒํผ์ ํด๋ฆญํ์ฌ ๋น๋ฐ๋ฒํธ ์ฐฝ์ ๋ซ์ต๋๋ค.
- ๊ทธ๋ฐ ๋ค์ Close(๋ซ๊ธฐ) ๋จ์ถ๋ฅผ ํด๋ฆญํ์ฌ Windows Credentials(Windows ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด) ์ฐฝ์ ๋ซ์ต๋๋ค.
- Visual Studio Solution Explorer(์๋ฃจ์ ํ์๊ธฐ) ์ฐฝ์์ ์ ํ๋ฆฌ์ผ์ด์ ์ ๋ง์ฐ์ค ์ค๋ฅธ์ชฝ ๋ฒํผ์ผ๋ก ํด๋ฆญํฉ๋๋ค.
- ์ปจํ ์คํธ ๋ฉ๋ด์์ Publish to Google Cloud(Google Cloud์ ๊ฒ์)๋ฅผ ํด๋ฆญํฉ๋๋ค.
- Publish(๊ฒ์) ๋ํ์์์์ Compute Engine์ ์ ํํฉ๋๋ค.
- Publish(๊ฒ์)๋ฅผ ํด๋ฆญํ์ฌ ์ํ ์ ํ๋ฆฌ์ผ์ด์ ์ ๋น๋ํ๊ณ ๋ฐฐํฌํฉ๋๋ค. ๊ฒ์๊ฐ ์๋ฃ๋๋ฉด Visual Studio๊ฐ ์ ํ๋ฆฌ์ผ์ด์ ์ ๊ธฐ๋ณธ ์น ๋ธ๋ผ์ฐ์ ์์ ์ฝ๋๋ค.
์ด์ ์ ํ๋ฆฌ์ผ์ด์ ์ด Compute Engine์์ ํธ์คํ ๋ฉ๋๋ค.
๋ค์ ๋จ๊ณ
- Compute Engine ๋ฆฌ์์ค ํ์์ ๋ํด ์์ธํ ์์๋ด ๋๋ค.