DEV Community

Cover image for Getting started with GraphQL in .NET 6 - Part 4 (Extra - Deploy to Azure Web App)
Bervianto Leo Pratama
Bervianto Leo Pratama

Posted on

2

Getting started with GraphQL in .NET 6 - Part 4 (Extra - Deploy to Azure Web App)

This post will be last part. I will give you videos about how I deploy it to Azure Web App (for Backend) and Azure Static Web App (for Frontend). I will give you some notes that you need to give more attention into it.

Video

Notes

BE Codes

  • I install the EF In Memory, since I don't want to deploy SQL Server at Azure yet. I have plan to post it to single article not in this series.
<ItemGroup>
    <!-- other dependencies... -->
    <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.0" />
    <!-- other codes ... -->
</ItemGroup>
Enter fullscreen mode Exit fullscreen mode
  • I update the Program.cs to use in memory.
// Add services to the container.
builder.Services.AddDbContext<NotesContext>(options =>
{
    // options.UseSqlServer(builder.Configuration.GetConnectionString("Default"));
    options.UseInMemoryDatabase("NotesTest");
});
Enter fullscreen mode Exit fullscreen mode

FE Codes

  • I update the backend (GraphQL) URL at index.tsx. You can update it to use environment instead of hardcoded, so you can setup the URL at build stage.
// other codes

const client = new ApolloClient({
  uri: 'https://graph-api-demo.azurewebsites.net/graphql',
  cache: new InMemoryCache()
});

// other codes
Enter fullscreen mode Exit fullscreen mode

Thank you

Great job gif

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay